package com.hymall.mapper;

import com.hymall.bean.MarketPermission;
import com.hymall.bean.MarketPermissionExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MarketPermissionMapper {
    long countByExample(MarketPermissionExample example);

    int deleteByExample(MarketPermissionExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketPermission record);

    int insertSelective(MarketPermission record);

    List<MarketPermission> selectByExample(MarketPermissionExample example);

    MarketPermission selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MarketPermission record, @Param("example") MarketPermissionExample example);

    int updateByExample(@Param("record") MarketPermission record, @Param("example") MarketPermissionExample example);

    int updateByPrimaryKeySelective(MarketPermission record);

    int updateByPrimaryKey(MarketPermission record);

    /**
     * 根据角色ID查找数据库中所有的permission
     *
     * @author: 叶熠彬
     * @date: 2022/7/18 9:23
     * @param: [roleId]
     * @return: java.util.List<java.lang.String>
     */
    List<String> selectPermissionsByRoleId(int roleId);

    List<String> selectPermissionsByAdminRoleIds(Integer[] adminRoleIds);

    List<String> selectAvailablePermissionsByAdminRoleIds(Integer[] adminRoleIds);

}